<ul class="nav">
    @if ( Sentry::getUser()->hasAccess('admin')) @include('nimo/domains/car_balance/menu') @endif
@foreach(array(
	(object)array('url'=>'#','icon'=>'fa fa-truck icon-white','title'=>'Машин',
		'sub'=> array(
			(object)array('url'=>route('car_balance.car.create.step1'),'icon'=>null,'title'=>'Машин бүртгэх')
			,(object)array('url'=>route('car_balance.main.car_list'),'icon'=>null,'title'=>'Машин жагсаалт')
		)
	)
	,(object)array('url'=>'#','icon'=>'fa fa-cogs icon-white','title'=>'Сэлбэг',
		'sub'=> array(
			(object)array('url'=>route('car_balance.parts.create'),'icon'=>null,'title'=>'Сэлбэг бүртгэх')
			,(object)array('url'=>route('car_balance.parts.index'),'icon'=>null,'title'=>'Сэлбэг жагсаалт')
		)
	)
	,(object)array('url'=>'#','icon'=>'fa fa-archive icon-white','title'=>'Контейнер',
		'sub'=> array(
			(object)array('url'=>route('car_balance.container.carlist'),'icon'=>null,'title'=>'Контейнерт хийх машины жагсаалт')
			,(object)array('url'=>route('car_balance.container.index'),'icon'=>null,'title'=>'Контейнер жагсаалт')
			,(object)array('url'=>route('car_balance.container.confirmed'),'icon'=>null,'title'=>'Контейнер жагсаалт-Confirmed')
		)
	)
	,(object)array('url'=>'#','icon'=>'fa fa-bank icon-white','title'=>'Банк', 'acdcess'=>array('admin'),
		'sub'=> array(
			(object)array('url'=>route('car_balance.money_exchange.index'),'icon'=>null,'title'=>'Банкны орлогын жагсаалт')
			,(object)array('url'=>route('car_balance.money_transfer.index'),'icon'=>null,'title'=>'Мөнгөний шилжүүлгийн жагсаалт')
		)
	)
	,(object)array('url'=>route('car_balance.main.document_car_list'),'icon'=>'fa fa-check icon-white','title'=>'Document', 'access'=>array('admin','operator'))
	,(object)array('url'=>'#','icon'=>'fa fa-money icon-white','title'=>'Нэхэмжлэл', 'access'=>array('admin','customer'),
		'sub'=> array(
			(object)array('url'=>route('car_balance.bill.create.step1'),'icon'=>null,'title'=>'Нэхэмжлэл үүсгэх машины жагсаалт')
			,(object)array('url'=>route('car_balance.bill.index'),'icon'=>null,'title'=>'Нэхэмжлэлийн жагсаалт')
		)
	)
	,(object)array('url'=>route('car_balance.main.summary'),'icon'=>'fa fa-calculator icon-white','title'=>'Тайлан', 'access'=>array('admin'))
	,(object)array('url'=>'#','icon'=>'fa fa-files-o icon-white','title'=>'ImpEx', 'access'=>array('admin'),
		'sub'=> array(
			(object)array('url'=>route('car_balance.main.export_car_list'),'icon'=>null,'title'=>'Car list export')
			,(object)array('url'=>route('car_balance.main.import_car_list'),'icon'=>null,'title'=>'Car list import')
			,(object)array('url'=>route('car_balance.main.recycle_csv'),'icon'=>null,'title'=>'Recycle')
			,(object)array('url'=>route('car_balance.main.fax_transmission_list'),'icon'=>null,'title'=>'オークションへ名義変更FAX送信')
		)
	)
	
) as $menu)

@if ( isset($menu->access) && !Sentry::getUser()->hasAnyAccess($menu->access))
<?php continue; ?>
@endif

@if ( isset($menu->sub))
	<li class="dropdown"> <a href="{{$menu->url}}" data-toggle="dropdown" class="dropdown-toggle"> <i class="{{$menu->icon}}"></i> {{$menu->title}} <span class="caret"></span></a> <ul class="dropdown-menu">
	@foreach($menu->sub as $m) <li> <a  href="{{$m->url}}" > {{$m->title}} </a></li> @endforeach
	</ul> </li>
@else
	<li> <a  href="{{$menu->url}}" > <i class="{{$menu->icon}}"></i> {{$menu->title}} </a></li>
@endif

@endforeach

    @if ( Sentry::getUser()->hasAccess('admin') || Sentry::getUser()->hasAccess('operator'))
    @endif
    @if ( Sentry::getUser()->hasAccess('admin') || Sentry::getUser()->hasAccess('customer'))
    @endif
    @if ( Sentry::getUser()->hasAccess('admin'))
    @endif
</ul>
